package com.woniuxy02;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author 作者
 * @create 2025-06-09 14:08
 */
public class Test03 {
    //ArrayList嵌套Map
    public static void main(String[] args) {
        Map<String,String> zsinfo=new HashMap<>();
        zsinfo.put("name","zs");
        zsinfo.put("age","11");
        zsinfo.put("gender","male");

        Map<String,Map<String,String>> infos=new HashMap<>();
        infos.put("zs001",zsinfo);

        Map<String,String> lsinfo=new HashMap<>();
        lsinfo.put("name","ls");
        lsinfo.put("age","12");
        lsinfo.put("gender","female");
        infos.put("ls002",lsinfo);

        //外层集合所有key的集合："zs001"，"ls002"
        Set<String> ids= infos.keySet();
        for(String id : ids){
            //id
            Map<String,String> usermap=infos.get(id);
            Set<String> keys=usermap.keySet();
            for(String key : keys){
                System.out.println(key);
                System.out.println(usermap.get(key));
            }
            System.out.println("----------------------");
        }

    }
}
